package cn.gzsendi.modules.mybatis.service.impl;

import cn.gzsendi.modules.mybatis.mapper.BmAreaCodeMapper;
import cn.gzsendi.modules.mybatis.model.BmAreaCode;
import cn.gzsendi.modules.mybatis.service.AreaCodeService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Program: mybatis_test
 * @Description: 查询实现类
 * @Author: tsh
 * @Create: 2021-01-07
 */
@Service
@Slf4j
public class AreaCodeImpl implements AreaCodeService {

    @Autowired
    private BmAreaCodeMapper areasCodeMapper;

    @Override
    public List<BmAreaCode> getAreaCodes(BmAreaCode bmareaCode) {

        Page<BmAreaCode> page = PageHelper.startPage(10, 20);
        areasCodeMapper.list(bmareaCode);
        log.info(page.getTotal()+"");

        return page.getResult();
    }
}
